home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 65 / Mac Magazin 65.iso / macware / Touch Folder / Touch Instructions < prev    next >
Encoding:
Text File  |  1999-11-09  |  2.4 KB  |  54 lines  |  [TEXT/ttxt]

  1. "Touch" Instructions
  2.  
  3. Copyright © 1999 William B. Davis Jr.   
  4.  
  5. E-mail: billd@ecity.net
  6.              bill.davis.jr@usa.net
  7.              billdavis@info-newt.com
  8.  
  9. This program is provided at no charge, without warranty or support of any kind.  Use at your own risk.  (Hey, what do you want for FREE?)
  10.  
  11. If you have problems, you can write to me, but I do NOT guarantee a response.   If you want a customized version or assistance with changing the program, there will be a consulting fee.
  12.  
  13. This AppleScript is like the Unix "touch" program -- it sets the modification date/time of whatever is dropped onto it to the current system date and time.  
  14.  
  15. The AppleScript is saved as a drag-and-drop application, but if you want to view or edit it, just drag the "Touch" icon onto the Script Editor.
  16.  
  17. Just for convenience, here's the actual script:
  18.  
  19. on open (docList)
  20.     tell application "Finder"
  21.         -- set theDate to current date
  22.         repeat with theFile in docList
  23.             if kind of theFile is not "folder" then
  24.                 --set theDate to current date
  25.                 --set theDate to date "8/1/96 12:34:56"
  26.                 -- note: can't set creation date in AppleScript; Finder treats as Read Only.
  27.                 --set creation date of file theFile to current date
  28.                 set modification date of file theFile to current date
  29.             end if
  30.         end repeat
  31.     end tell
  32. end open
  33.  
  34.  
  35. The lines that are commented out are notes from development or are possible changes to modify this script for the specific purposes discussed below.   The following information has not been extensively tested, it may or may not work, use at your own risk:
  36.  
  37. SETTING ALL FILES TO THE SAME TIME
  38. Normally, we probably don't need to, but if you need to set all files dropped on it to the exact same date and time would be to uncomment (that means remove the "---" from in front of) the "--set theDate to current date" right below the "tell application Finder", and change the "set modification date of file theFile to current date" to  "set modification date of file theFile to current date" to theDate".
  39.  
  40.  
  41. SETTING ALL FILES TO A SPECIFIC TIME
  42. If you need to set the date and time to a SPECIFIC date and time, uncomment the line:
  43.  
  44.                 --set theDate to date "8/1/96 12:34:56"
  45.  
  46. Change the date and time from 8/1/96 12:34:56 to whatever date/time you need and change the "set modification date of file theFile to current date" to  "set modification date of file theFile to current date" to theDate".
  47.  
  48.  
  49.  
  50. VERSION HISTORY
  51.  
  52. Version 1.0  - 09-NOV-1999 - released to public 
  53.  
  54.